Optimal. Leaf size=18 \[ i \sin (x)-\cos (x)-i \tanh ^{-1}(\sin (x)) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.101674, antiderivative size = 18, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 7, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.636, Rules used = {3518, 3108, 3107, 2638, 2592, 321, 206} \[ i \sin (x)-\cos (x)-i \tanh ^{-1}(\sin (x)) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3518
Rule 3108
Rule 3107
Rule 2638
Rule 2592
Rule 321
Rule 206
Rubi steps
\begin{align*} \int \frac{\sec (x)}{i+\cot (x)} \, dx &=-\int \frac{\tan (x)}{-\cos (x)-i \sin (x)} \, dx\\ &=i \int (-i \cos (x)-\sin (x)) \tan (x) \, dx\\ &=i \int (-i \sin (x)-\sin (x) \tan (x)) \, dx\\ &=-(i \int \sin (x) \tan (x) \, dx)+\int \sin (x) \, dx\\ &=-\cos (x)-i \operatorname{Subst}\left (\int \frac{x^2}{1-x^2} \, dx,x,\sin (x)\right )\\ &=-\cos (x)+i \sin (x)-i \operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\sin (x)\right )\\ &=-i \tanh ^{-1}(\sin (x))-\cos (x)+i \sin (x)\\ \end{align*}
Mathematica [B] time = 0.033853, size = 44, normalized size = 2.44 \[ -\cos (x)+i \left (\sin (x)+\log \left (\cos \left (\frac{x}{2}\right )-\sin \left (\frac{x}{2}\right )\right )-\log \left (\sin \left (\frac{x}{2}\right )+\cos \left (\frac{x}{2}\right )\right )\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.041, size = 34, normalized size = 1.9 \begin{align*}{2\,i \left ( \tan \left ({\frac{x}{2}} \right ) -i \right ) ^{-1}}-i\ln \left ( \tan \left ({\frac{x}{2}} \right ) +1 \right ) +i\ln \left ( \tan \left ({\frac{x}{2}} \right ) -1 \right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.26699, size = 61, normalized size = 3.39 \begin{align*} -\frac{2}{\frac{i \, \sin \left (x\right )}{\cos \left (x\right ) + 1} + 1} - i \, \log \left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1} + 1\right ) + i \, \log \left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1} - 1\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{{\left (-i \, e^{\left (3 i \, x\right )} + i \, e^{\left (i \, x\right )}\right )} e^{\left (-2 i \, x\right )}}{e^{\left (2 i \, x\right )} + 1}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\sec{\left (x \right )}}{\cot{\left (x \right )} + i}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.31099, size = 42, normalized size = 2.33 \begin{align*} \frac{2 i}{\tan \left (\frac{1}{2} \, x\right ) - i} - i \, \log \left ({\left | \tan \left (\frac{1}{2} \, x\right ) + 1 \right |}\right ) + i \, \log \left ({\left | \tan \left (\frac{1}{2} \, x\right ) - 1 \right |}\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]